home *** CD-ROM | disk | FTP | other *** search
-
- /*-----------------------------------------------------------------------*/
- /* ARexx script for Amiga Imagine 5.0 */
- /* Creates a planisphere only composed of twirling longitudes */
- /* */
- /* Author: Anh Tu NGUYEN TRONG */
- /* Email: atnt@diaf.fr */
- /* */
- /* Requirements */
- /* - Workbench 2.04 or higher */
- /* - rexxreqtools.library 1.3 or higher */
- /* - reqtools.library 38 or higher */
- /* - Imagine 5.0 */
- /* */
- /* The rexxreqtools and reqtools libraries can be retrieved from Aminet. */
- /* rexxreqtools is an ARexx interface to reqtools. */
- /* */
- /* The script can be run without the rexxreqtools library: */
- /* just remove the delimited section. You can edit the source to */
- /* change the parameters. */
- /* */
- /* Warning */
- /* the ARexx script doesn't check the validity of the three numbers. */
- /* */
- /* Usage */
- /* - Imagine 5.0 should be already launched */
- /* - From a Shell window: rx twirl.irx */
- /* */
- /* Three numbers have to be entered through requesters: */
- /* - radius (default value: 100) (must be an even value) */
- /* - circle_sections_number (default value: 24) (must be an even value) */
- /* - sections_number (default value: 12) (must be an even value) */
- /* */
- /* Note */
- /* By modifiying the source, you can generate a sphere with the */
- /* half portion filled. */
- /*-----------------------------------------------------------------------*/
-
- /*******************************************************************/
-
- /* Beginning of twirl.irx */
-
-
- /* Sphere's parameters that can be altered manually if the */
- /* rexxreqtools library is not used. */
-
- radius = 100
- circle_sections_number = 24
- sections_number = 12
-
-
- /* --8<-- Start of rexxreqtools part which may be removed ----- */
-
- call addlib("rexxreqtools.library", 0, -30, 0)
-
-
- radius_box_title = "Radius"
- radius_box_message = "Sphere radius ?"
-
- circle_sections_box_title = "Circle sections"
- circle_sections_box_message = "Number of circle sections ?"
-
- vertical_sections_box_title = "Vertical sections"
- vertical_sections_box_message = "Number of vertical sections ?"
-
- buttons_labels="_OK|_Abort script"
-
-
- radius = rtgetlong(radius,,
- radius_box_message,,
- radius_box_title,,
- buttons_labels,,
- ,,
- code_retour)
-
- if radius == "" then
- exit
-
-
- circle_sections_number = rtgetlong(circle_sections_number,,
- circle_sections_box_message,,
- circle_sections_box_title,,
- buttons_labels,,
- ,,
- code_retour)
-
- if circle_sections_number == "" then
- exit
-
-
- sections_number = rtgetlong(sections_number,,
- vertical_sections_box_message,,
- vertical_sections_box_title,,
- buttons_labels,,
- ,,
- code_retour)
-
- if sections_number == "" then
- exit
-
- /* --8<-- End of rexxreqtools part which may be removed ----- */
-
-
- address "Imagine.1"
-
-
- displayrexxptr on
-
- detaileditor
- objectmode
-
- addsphere radius circle_sections_number sections_number 'OFF'
-
- pick select
-
- /* Number of faces computation */
-
- faces_number = ((sections_number - 2) * circle_sections_number * 2) + (2 * circle_sections_number)
-
-
- /* Computation of the number of faces pairs by circumference */
-
- pairs_number = circle_sections_number / 2
-
-
- facemode
- multipickon
-
-
- /* Selection of the faces of the first circumference */
- /* Particular case because of 2 times less faces */
-
- numero = 1
-
- do until numero >= (circle_sections_number + 1)
- pick numero
- numero = numero + 2
- end
-
-
- /* Faces selection */
-
- numero = circle_sections_number + 1
- pairs_counter = 0
-
- even_increment = 3
- odd_increment = 3
-
-
- do until (numero >= (faces_number - circle_sections_number))
-
-
- pick numero
-
- numero = numero + 1
- pick numero
- pairs_counter = pairs_counter + 1
-
-
- if (pairs_counter = pairs_number) then
- do
-
- numero = numero + even_increment
- even_increment = even_increment - 1
-
- pairs_counter = 0.5
- pick numero
- numero = numero + 3
- end
-
- else
- do
- if (pairs_counter = (pairs_number - 0.5)) then
- do
- numero = numero + odd_increment
-
- /* Strange but it works !!!*/
- even_increment = odd_increment - 1
-
- pick numero
- pairs_counter = 0
- numero = numero + 2
- end
-
- else
- do
- numero = numero + 3
- end
-
- end
-
- end
-
-
- /* Selection of the faces of the last circumference */
- /* Particular case because of 2 times less faces */
-
- numero = faces_number - circle_sections_number
-
- do until numero > faces_number
- pick numero
- numero = numero + 2
- end
-
-
- /* Deletion of selected faces */
- delete
-
- multipickoff
- objectmode
-
- displayrexxptr off
- beep
- exit
-
- /* End of twirl.irx */
-
- /*******************************************************************/
-